/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package py.com.peluq.model.entity;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinColumns;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author Diego_M
 */
@Entity
@Table(name = "conci_banco", catalog = "peludb", schema = "")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "ConciBanco.findAll", query = "SELECT c FROM ConciBanco c"),
    @NamedQuery(name = "ConciBanco.findByIdconciBanco", query = "SELECT c FROM ConciBanco c WHERE c.idconciBanco = :idconciBanco"),
    @NamedQuery(name = "ConciBanco.findByMontoCredito", query = "SELECT c FROM ConciBanco c WHERE c.montoCredito = :montoCredito"),
    @NamedQuery(name = "ConciBanco.findByMontoDebito", query = "SELECT c FROM ConciBanco c WHERE c.montoDebito = :montoDebito"),
    @NamedQuery(name = "ConciBanco.findByFecha", query = "SELECT c FROM ConciBanco c WHERE c.fecha = :fecha"),
    @NamedQuery(name = "ConciBanco.findByConciliar", query = "SELECT c FROM ConciBanco c WHERE c.conciliar = :conciliar")})
public class ConciBanco implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @NotNull
    @Column(name = "idconci_banco", nullable = false)
    private Integer idconciBanco;
    @Column(name = "monto_credito")
    private Integer montoCredito;
    @Column(name = "monto_debito")
    private Integer montoDebito;
    @Column(name = "fecha")
    private Integer fecha;
    @Column(name = "conciliar")
    private Integer conciliar;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "conciBanco")
    private Collection<BolDeposito> bolDepositoCollection;
    @JoinColumns({
        @JoinColumn(name = "idctas_titular", referencedColumnName = "idctas_titular", nullable = false),
        @JoinColumn(name = "idctas_corrientes", referencedColumnName = "idctas_corrientes", nullable = false)})
    @ManyToOne(optional = false)
    private CtasTitular ctasTitular;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "conciBanco")
    private Collection<PagoCheque> pagoChequeCollection;

    public ConciBanco() {
    }

    public ConciBanco(Integer idconciBanco) {
        this.idconciBanco = idconciBanco;
    }

    public Integer getIdconciBanco() {
        return idconciBanco;
    }

    public void setIdconciBanco(Integer idconciBanco) {
        this.idconciBanco = idconciBanco;
    }

    public Integer getMontoCredito() {
        return montoCredito;
    }

    public void setMontoCredito(Integer montoCredito) {
        this.montoCredito = montoCredito;
    }

    public Integer getMontoDebito() {
        return montoDebito;
    }

    public void setMontoDebito(Integer montoDebito) {
        this.montoDebito = montoDebito;
    }

    public Integer getFecha() {
        return fecha;
    }

    public void setFecha(Integer fecha) {
        this.fecha = fecha;
    }

    public Integer getConciliar() {
        return conciliar;
    }

    public void setConciliar(Integer conciliar) {
        this.conciliar = conciliar;
    }

    @XmlTransient
    public Collection<BolDeposito> getBolDepositoCollection() {
        return bolDepositoCollection;
    }

    public void setBolDepositoCollection(Collection<BolDeposito> bolDepositoCollection) {
        this.bolDepositoCollection = bolDepositoCollection;
    }

    public CtasTitular getCtasTitular() {
        return ctasTitular;
    }

    public void setCtasTitular(CtasTitular ctasTitular) {
        this.ctasTitular = ctasTitular;
    }

    @XmlTransient
    public Collection<PagoCheque> getPagoChequeCollection() {
        return pagoChequeCollection;
    }

    public void setPagoChequeCollection(Collection<PagoCheque> pagoChequeCollection) {
        this.pagoChequeCollection = pagoChequeCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idconciBanco != null ? idconciBanco.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ConciBanco)) {
            return false;
        }
        ConciBanco other = (ConciBanco) object;
        if ((this.idconciBanco == null && other.idconciBanco != null) || (this.idconciBanco != null && !this.idconciBanco.equals(other.idconciBanco))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "py.com.peluq.model.entity.ConciBanco[ idconciBanco=" + idconciBanco + " ]";
    }
    
}
